﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;

namespace PefStudio.Windows
{
    [Export(MainViewMenu.Contract, typeof(IMenuItem))]
    sealed class MainViewMenuFileExplorer : AbstractMenuItem
    {
        public MainViewMenuFileExplorer()
        {
            ID = "FileExplorerWindow";
            Text = "File Explorer Window";
        }

        protected override void OnClick(EventArgs e)
        {
            var pad = (PropertyPad)MainWindow.FindPad(typeof(FileExplorerPad));
            if (pad != null)
                pad.Activate();
            else
            {
                var propertyPad = MainWindow.CompositionContainer.GetExportedValue<AbstractPad>(FileExplorerPad.Contract);
                MainWindow.ShowPad(propertyPad);
            }
        }
    }
}
